package com.sh.rpc.registry;

import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;

/**
 * 本地注册中心
 * @author sh
 */
public class LocalRegistry {

    // 存储
    public static final Map<String, Class<?>> map =  new ConcurrentHashMap<>();

    // 注册
    public static void register(String serviceName, Class<?> implClass){
        map.put(serviceName, implClass);
    }

    // 发现
    public static Class<?> get(String serviceName){
        return map.get(serviceName);
    }

    // 取消
    public static void remove(String serviceName){
        map.remove(serviceName);
    }


}
